﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Ah.Testudin.Engine.Graphics
{
    public struct VertexPositionColorNormal : IVertexType
    {
        public Vector3 Position;
        
        public Color Color;
        
        public Vector3 Normal;

        public readonly static VertexDeclaration VertexPositionColorNormalVertexDeclaration = new VertexDeclaration
        (
            new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
            new VertexElement(sizeof(float) * 3, VertexElementFormat.Color, VertexElementUsage.Color, 0),
            new VertexElement(sizeof(float) * 3 + 4, VertexElementFormat.Vector3, VertexElementUsage.Normal, 0)
        );

        public VertexDeclaration VertexDeclaration
        {
            get { return VertexPositionColorNormal.VertexPositionColorNormalVertexDeclaration; }
        }
    }
}
